Add task information in the allocation logs when create or delete an instance #5623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When an instance was created or deleted, the logs only contained information about the instance ID, making it difficult to recognize each instance if more than one was created or deleted at the same time.
To improve this, more details have been added to the logs to identify the instance more easily. When an action is performed with the instance, the logs now display both the name and ID of the current instance.
Note
This change is only effective for instance creation in AWS because when creating a VM with vagrant the identifier is the machine name itself and it does not make sense to display it twice.
Additionally, the issue has been fixed where, when rolling back the creation of an instance, the message
[yyy-mm-dd hh:mm:ss] [INFO] ALLOCATOR: Instance i-<id> deleted
was displayed twice along with the message[yyy-mm-dd hh:mm:ss] [INFO] ALLOCATOR: Instance i-<id> created successfully
, which was contradictory.[2024-07-30 12:36:26] [INFO] ALLOCATOR [QA-5614-UBUNTU-22.04]: Instance i-02de975e0d07f8b70 deleted.
Tests
AWS
--label-issue
--instance-name
--composite-name
Vagrant
As shown, the logs with vagrant are not modified.
AWS
Vagrant